package com.weiaibenpao.demo.chislim.ui;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;

import com.jaeger.library.StatusBarUtil;
import com.weiaibenpao.demo.chislim.R;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * Created by Administrator on 2017/10/18.
 */

public class MatchDescriptionActivity extends AppCompatActivity {
    @BindView(R.id.tv_match_name)
    TextView tvMatchName;
    @BindView(R.id.tv_match_desc)
    TextView tvMatchDesc;
    public static final String DESCRIPTION = "desc";
    public static final String TITLE = "title";


    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_match_description);
        ButterKnife.bind(this);
        StatusBarUtil.setColor(this , getResources().getColor(R.color.blackbg ) , 0);
        initView();
    }

    private void initView() {
        if(getIntent() != null){
            String matchName = getIntent().getStringExtra(TITLE);
            String desc = getIntent().getStringExtra(DESCRIPTION);
            tvMatchName.setText(matchName);
            tvMatchDesc.setHint(desc);
        }
    }


    public static void openActivity(Context context,String title,String description){
        Intent intent = new Intent(context,MatchDescriptionActivity.class);
        intent.putExtra(TITLE,title);
        intent.putExtra(DESCRIPTION,description);
        context.startActivity(intent);
    }

    @OnClick({R.id.iv_back})
    public void onClick(View view){
        finish();
    }





}
